#include <iostream>
#include <vector>

using namespace std;

void printPascalTriangle(int rows)
{
    vector<vector<int>> triangle(rows);

    for (int n = 0; n < rows; n++)
    {
        triangle[n].resize(n + 1);
        triangle[n][0] = triangle[n][n] = 1;

        // 打印前导空格
        for (int space = 0; space < rows - n - 1; space++)
        {
            cout << " ";
        }

        // 计算并打印当前行
        for (int k = 1; k < n; k++)
        {
            triangle[n][k] = triangle[n - 1][k - 1] + triangle[n - 1][k];
        }

        for (int k = 0; k <= n; k++)
        {
            cout << triangle[n][k] << " ";
        }
        cout << endl;
    }
}

int main()
{
    int rows;
    cin >> rows;

    printPascalTriangle(rows);

    return 0;
}